package xyz.riceball.job.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.riceball.framework.core.annotation.RbLog;
import xyz.riceball.framework.core.annotation.RbSysRequest;
import xyz.riceball.framework.core.bean.ApiController;
import xyz.riceball.framework.core.bean.ApiR;
import xyz.riceball.job.entity.po.JobLogPO;
import xyz.riceball.job.service.JobLogService;

import javax.annotation.Resource;


/**
 * 定时任务调度日志表 控制层
 *
 * @author xiaovcloud
 * @since 2022-06-16 19:02:39
 */
@RestController
@RbSysRequest
@RequestMapping("/api/rb/jobLog")
public class JobLogController extends ApiController {

    @Resource
    private JobLogService jobLogService;

    @ApiOperation(value = "分页查询任务日志")
    @RbLog(description = "分页查询任务日志")
    @GetMapping
    public ApiR<Page<JobLogPO>> selectAll(Page<JobLogPO> page, JobLogPO jobLogPO) {
        return success(jobLogService.page(page, new QueryWrapper<>(jobLogPO)));
    }

}
